function loadPage(url,typeId) {
	$.get(url+"?time="+new Date(),{typeId:typeId}, function(result){
	    if (result.code == "403") {
            $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">没有权限</div></div>', {
                'title': '提示',
                'buttons': ['确定']
            });
        } else {
          $("body").html(result);
        }
	  });
}


function Wcrw(url) {
	if ($('#kk').find('li[class="active"]').length<1||$('#kk').find('li[class="active"]').length<=0) {
	    $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">请选择一条数据</div></div>', {
	        'title': '提示',
	        'buttons': ['确定']
	    });

	} else {
	    var id = $('#kk').find('li[class="active"]').attr("id");
	     var typeId = $('.plan').find('a[class="active"]').attr("id");

	    $.ajax({
	        type: "post",
	        dataType: "json",
	        data: {
	            id: id
	        },
	        url: url,
	        success: function(data, status) {
	            if (data.code == "403") {

	                $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">没有权限</div></div>', {
	                    'title': '提示',
	                    'show_close_button': false,
	                    'buttons': [{
	                        caption: '确定',
	                        callback: function() {
	                            //window.location.href = "/user";
	                            loadPage("/myplan",typeId);
	                        }
	                    }]
	                });

	            } else {
	            	if(data.code == "1"){
	            		   $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">计划未开始</div></div>', {
	   	                    'title': '提示',
	   	                    'show_close_button': false,
	   	                    'buttons': [{
	   	                        caption: '确定',
	   	                        callback: function() {
	   	                            loadPage("/myplan",typeId);

	   	                        }
	   	                    }]
	   	                });
	            	}else{
	            		   $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">保存成功</div></div>', {
	   	                    'title': '提示',
	   	                    'show_close_button': false,
	   	                    'buttons': [{
	   	                        caption: '确定',
	   	                        callback: function() {
	   	                            loadPage("/myplan",typeId);

	   	                        }
	   	                    }]
	   	                });
	            	}
	 
	             
	            }
	        },
	        error: function(data) {

	            $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">保存失败!</div></div>', {
	                'title': '提示',
	                'show_close_button': false,
	                'buttons': [{
	                    caption: '确定',
	                    callback: function() {
	                        loadPage("/myplan",typeId);

	                    }
	                }]
	            });

	        }
	    });
	}
	
}

